# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

# Graphs2D Tests
if(QT_FEATURE_graphs_2d)
    if(TARGET Qt::Quick)
        if(WIN32 AND QT_FEATURE_graphs_2d_bar AND QT_FEATURE_graphs_2d_scatter)
            add_subdirectory(qmlbarscatter)
        endif()
        if(QT_FEATURE_graphs_2d_area AND QT_FEATURE_graphs_2d_bar AND QT_FEATURE_graphs_2d_donut_pie AND QT_FEATURE_graphs_2d_line AND QT_FEATURE_graphs_2d_scatter AND QT_FEATURE_graphs_2d_spline)
            add_subdirectory(qmltestbed)
        endif()
        if(QT_FEATURE_graphs_2d_area AND QT_FEATURE_graphs_2d_bar AND QT_FEATURE_graphs_2d_line)
            add_subdirectory(qmlbenchmark2d)
        endif()
        if(QT_FEATURE_graphs_2d_line)
            add_subdirectory(qmlline)
        endif()
        if(QT_FEATURE_graphs_2d_area AND QT_FEATURE_graphs_2d_bar)
            add_subdirectory(qmlmultiplebarseries)
            add_subdirectory(qmlnegativebarsets)
        endif()
        if(QT_FEATURE_graphs_2d_area)
            add_subdirectory(qmlgradientareas)
        endif()
        if(QT_FEATURE_graphs_2d_donut_pie)
            add_subdirectory(qmlsubpieslices)
            add_subdirectory(qml2dpiegraph)
        endif()
    endif()
endif()

# Graphs3D Tests
if(QT_FEATURE_graphs_3d)
    if(TARGET Qt::Quick)
        if(QT_FEATURE_graphs_3d_bars3d)
            add_subdirectory(qmlbarsrowcolors)
            add_subdirectory(qmllegend)
            if(DEFINED Qt6Multimedia_DIR AND DEFINED Qt6MultimediaWidgets_DIR)
                add_subdirectory(qmlqtquick3dintegration)
            endif()
        endif()
        if(QT_FEATURE_graphs_3d_scatter3d)
            add_subdirectory(qmlcustominput)
            add_subdirectory(qmldynamicdata)
            add_subdirectory(qmlspline)
            add_subdirectory(qmlvectorfield)
        endif()
        if(QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(qmlgradient)
            add_subdirectory(qmlheightmap)
            add_subdirectory(qmlsurfacelayers)
            add_subdirectory(qmlvolume)
        endif()
        if(QT_FEATURE_graphs_3d_bars3d AND QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(qmltheme)
            add_subdirectory(qmlrenderslicetoimage)
        endif()
        if(QT_FEATURE_graphs_3d_bars3d AND QT_FEATURE_graphs_3d_scatter3d AND QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(qmlmultitest)
            add_subdirectory(qmlperf)
            add_subdirectory(qmlinjection)
            add_subdirectory(qmlmultiaxis3d)
        endif()
    endif()
    if(NOT ANDROID AND NOT IOS AND NOT WINRT)
        if(QT_FEATURE_graphs_3d_bars3d)
            add_subdirectory(barstest)
            add_subdirectory(minimalbars)
        endif()
        if(QT_FEATURE_graphs_3d_scatter3d)
            add_subdirectory(custominput)
            add_subdirectory(directional)
            add_subdirectory(minimalscatter)
            add_subdirectory(rotations)
            add_subdirectory(scattertest)
        endif()
        if(QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(minimalsurface)
            add_subdirectory(surfacetest)
        endif()
        if(QT_FEATURE_graphs_3d_bars3d AND QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(itemmodel)
            add_subdirectory(itemmodeltest)
            add_subdirectory(renderslicetoimage)
        endif()
        if(QT_FEATURE_graphs_3d_bars3d AND QT_FEATURE_graphs_3d_scatter3d AND QT_FEATURE_graphs_3d_surface3d)
            add_subdirectory(multigraphs)
            add_subdirectory(volumetrictest)
        endif()
    endif()
endif()

#2D line test
if(QT_FEATURE_graphs_2d AND QT_FEATURE_graphs_3d)
    add_subdirectory(qml2dperformance)
endif()
